home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / INSERT EXTRUSION.SCRIPT < prev    next >
Encoding:
Text File  |  1998-02-13  |  1.9 KB  |  63 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: insert Extrusion~inserts the Extrusion node. The Extrusion node specifies geometric 
  6. shapes based on a two dimensional cross-section extruded along a three dimensional 
  7. spine in the local coordinate system. 
  8. @EndTool: 
  9. @Summary: insert Extrusion~inserts the Extrusion node
  10. */
  11.  
  12. var Node = 
  13. "Extrusion {" +
  14. "\n\t                         # set_crossSection eventIn MFVec2f" +   
  15. "\n\t                         # set_orientation eventIn MFRotation" + 
  16. "\n\t                         # set_scale eventIn MFVec2f" +   
  17. "\n\t                         # set_spine eventIn MFVec3f" +   
  18. "\n\tbeginCap         TRUE    # field   SFBool" +     
  19. "\n\tccw              TRUE    # field   SFBool" +     
  20. "\n\tconvex           TRUE    # field   SFBool" +     
  21. "\n\tcreaseAngle      0       # field   SFFloat" +    
  22. "\n\tcrossSection             # field   MFVec2f" + 
  23. "\n\t[" + 
  24. "\n\t\t1 1, 1 -1, -1 -1, -1 1, 1 1" + 
  25. "\n\t]" +        
  26. "\n\tendCap           TRUE    # field   SFBool" +    
  27. "\n\torientation              # field   MFRotation" + 
  28. "\n\t[" + 
  29. "\n\t\t0 0 1 0" + 
  30. "\n\t]" +        
  31. "\n\tscale                    # field   MFVec2f" +   
  32. "\n\t[" + 
  33. "\n\t\t1 1" + 
  34. "\n\t]" +        
  35. "\n\tsolid            TRUE    # field   SFBool" +     
  36. "\n\tspine                    # field   MFVec3f" + 
  37. "\n\t[" + 
  38. "\n\t\t0 0 0, 0 1 0" + 
  39. "\n\t]" +      
  40. "\n}" +
  41. "\n@Caret";
  42.  
  43. function DoCommand()
  44. {
  45.   var textUtilities = getScriptObject("Library\\textUtilities.script");
  46.   if (textUtilities)
  47.   {
  48.     var editor = getActiveEditor();
  49.     if (editor)
  50.     {
  51.       var lineIndex = textUtilities.InsertString(editor, Node);
  52.       
  53.       // Now replace @Caret with the real caret
  54.       var range = editor.findFirst("@Caret", lineIndex, 0);
  55.       editor.replace("", range);
  56.       editor.setActive("Insert Extrusion Node");
  57.     }
  58.   }
  59. }
  60.  
  61. !!/Script
  62.  
  63.